package models
type SystemSourceLevel struct {
	Id           int `json:"id" xorm:"not null pk autoincr comment('主键') INT(11)"`
	SourceId int `json:"subject_id" xorm:"not null comment('题目来源主键') INT(11)"`
	LevelId int `json:"type_id" xorm:"not null comment('阶段主键')  INT(11)"`
}
var systemsourcelevel ="system_source_level"

func(s *SystemSourceLevel) GetRow() bool {
	has, err := mEngine.Get(s)
	if err==nil &&  has  {
		return true
	}
	return false
}

func(s *SystemSourceLevel) GetBySourceId(sourceId int) ([]string,error) {
	var levelIdArr []string
	err:=mEngine.Table(systemsourcelevel).Cols("level_id").Where("source_id = ?",sourceId).Find(&levelIdArr)

	return levelIdArr,err

}